<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>钻石投票_举报记录</title>
    <link rel="stylesheet" href="__MCSS__/bass.css">
    <link rel="stylesheet" href="__CSS__/font-awesome.css">
    <link rel="stylesheet" href="__JS__/layui/css/layui.css"/>
    <link rel="stylesheet" href="__MCSS__/layui-pageadd.css"/>
    <link rel="stylesheet" href="__MCSS__/public.css"/>
    <link rel="stylesheet" href="__MCSS__/report_count.css">
    <link rel="stylesheet" href="__MCSS__/layui-add.css">
</head>
<body>

<div class="report-count">
    <div class="report-count-body">
        <!--面包屑-->
        <p class="bread-crumbs-nav"><span class="span1">数据记录</span><i class="fa fa-caret-right"></i><span class="span2">举报记录</span>
        </p>

        <div class="report-tit">
            <div class="report-tit-seach">
                <p><input type="text" value="{$keyword}" placeholder="搜索投票人IP/昵称"></p>
                <span>搜索</span>
            </div>
            <div class="report-tit-day">
                <div data-day="all" class="report-day-msg {eq name="day" value="all"}report-day-active{/eq}">全部</div>
                <div data-day="yestoday" class="report-day-msg {eq name="day" value="yestoday"}report-day-active{/eq}">昨日</div>
                <div data-day="today" class="report-day-msg {eq name="day" value="today"}report-day-active{/eq}">今日</div>
                <div data-day="three" class="report-day-msg {eq name="day" value="three"}report-day-active{/eq}">近3日</div>
                <div data-day="week" class="report-day-msg {eq name="day" value="week"}report-day-active{/eq}">近7日</div>
            </div>
            <div class="report-tit-date">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">日期范围</label>

                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" id="report-date-choose" placeholder="请选择时间段">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="report-table">
            <div class="report-table-tit">
                <ul>
                    <li class="report-tit-li1">ID</li>
                    <li class="report-tit-li2">IP</li>
                    <li class="report-tit-li3">活动名称</li>
                    <li class="report-tit-li4">举报页面</li>
                    <li class="report-tit-li5">举报次数</li>
                    <li class="report-tit-li6">举报内容</li>
                    <li class="report-tit-li7">时间</li>
                </ul>
            </div>
            <div class="report-table-body">
                {volist name="lists" id="vo"}
                <ul>
                    <li class="report-tit-li1">{$vo.id}</li>
                    <li class="report-tit-li2">{$vo.last_ip}</li>
                    <li class="report-tit-li3"><a href="">{$vo.title}</a></li>
                    <li class="report-tit-li4">活动选手页（<a href="">选手标号：{$vo.competitor_id}；姓名：{$vo.competitor_name}</a>）</li>
                    <li class="report-tit-li5">6</li>
                    <li class="report-tit-li6">{$vo.msg_info}</li>
                    <li class="report-tit-li7">{$vo.create_time}</li>
                </ul>
                {/volist}
            </div>
        </div>

        <div class="report-page">
            <div id="report-page-list"></div>
        </div>

    </div>
</div>
<script src="__JS__/jquery_v3.3.1.js"></script>
<script src="__JS__/layer/layer.js"></script>
<script src="__JS__/layui/layui.js"></script>
<script src="__MJS__/common.js"></script>
<script type="text/javascript">

    // 选择日期
    $('.report-day-msg').click(function () {
        $('.report-day-msg').removeClass('report-day-active');
        $(this).addClass('report-day-active').siblings().removeClass('report-day-active');
        console.log($(this).attr('data-day'));
        var day=$(this).attr('data-day');
        if(day.length<1){
            return false;
        }
        var params = getParams();
        params.day = day;
        var param_array = [];
        Object.keys(params).forEach(function (key) {
            if(key!='btime'){
                param_array.push(key + '=' + params[key]);
            }
        });
        var param_str = '?' + param_array.join('&');
        window.location.href = "/admin/complaint/lists.html" + param_str;
    });

    /**
     * 搜索
     */
    $('.report-tit-seach span').click(function(){
        var keyword = $(this).prev('p').find('input').val();
        if(keyword.length<1){
            return false;
        }
        var params = getParams();
        params.keyword = keyword;
        var param_array = [];
        Object.keys(params).forEach(function (key) {
            param_array.push(key + '=' + params[key]);
        });
        var param_str = '?' + param_array.join('&');
        window.location.href = "/admin/complaint/lists.html" + param_str;
    });

    //时间日期
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#report-date-choose'
            , range: true
            ,done: function(value, date, endDate){
                var params = getParams();
                params.btime = value;
                var param_array = [];
                Object.keys(params).forEach(function (key) {
                    if(key!='day'){
                        param_array.push(key + '=' + params[key]);
                    }
                });
                var param_str = '?' + param_array.join('&');
                window.location.href = "/admin/complaint/lists.html" + param_str;
            }
        });
    });


    //分页
    layui.use('laypage', function () {
        var laypage = layui.laypage;

        laypage.render({
            elem: 'report-page-list', //注意，这里的 test1 是 ID，不用加 # 号
            count: 80, //数据总数，从服务端得到
            layout: ['count', 'prev', 'page', 'next', 'skip'],
            groups: 4,
            limit: 20,
            jump: function (obj, first) {
                //obj包含了当前分页的所有参数，比如：
                console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                console.log(obj.limit); //得到每页显示的条数
            }
        });
    });

</script>
</body>
</html>